package clientproject.window;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;

import clientproject.Client;

import serverproject.model.Account;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class LoginWindow
{

	private JFrame	frame;
	private JTextField idField;
	private JTextField passWorldField;

	public static void main(String args[])
	{
		new LoginWindow();
	}
	/**
	 * Create the application.
	 */
	public LoginWindow()
	{
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize()
	{
		frame = new JFrame();
		frame.setBounds(100, 100, 380, 121);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JLabel lblNewLabel = new JLabel("I         D");
		lblNewLabel.setBounds(26, 20, 57, 15);
		frame.getContentPane().add(lblNewLabel);
		
		JLabel label = new JLabel("비밀번호");
		label.setBounds(26, 45, 57, 15);
		frame.getContentPane().add(label);
		
		idField = new JTextField();
		idField.setBounds(91, 17, 116, 21);
		frame.getContentPane().add(idField);
		idField.setColumns(10);
		
		passWorldField = new JTextField();
		passWorldField.setBounds(91, 42, 116, 21);
		frame.getContentPane().add(passWorldField);
		passWorldField.setColumns(10);
		
		JButton button = new JButton("로그인");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new Client(new Account(idField.getText(), null, passWorldField.getText(), null));
			}
		});
		button.setBounds(231, 16, 97, 23);
		frame.getContentPane().add(button);
		
		JButton btnNewButton = new JButton("계정생성");
		btnNewButton.setBounds(231, 41, 97, 23);
		frame.getContentPane().add(btnNewButton);
		frame.setVisible(true);
	}
}
